﻿using System;

namespace NUnit.Framework
{
    public static class ObjectAssertions
    {
        public static void ShouldBeNull(this object actual)
        {
            Assert.IsNull(actual);
        }

        public static void ShouldNotBeNull(this object actual)
        {
            Assert.IsNotNull(actual);
        }

        public static void ShouldBeSameTheSameAs(this object actual, object expected)
        {
            Assert.AreSame(expected, actual);
        }

        public static void ShouldNotBeSameTheSameAs(this object actual, object expected)
        {
            Assert.AreNotSame(expected, actual);
        }

        public static T ShouldBeOfType<T>(this object actual)
        {
            actual.ShouldNotBeNull();
            Assert.IsInstanceOf<T>(actual);
            return (T)actual;
        }

        public static T ShouldBeInstanceOf<T>(this object actual)
        {
            actual.ShouldNotBeNull();
            Assert.IsInstanceOf<T>(actual);
            return (T)actual;
        }

        public static void ShouldNotBeOfType(this object actual, Type expected)
        {
            Assert.IsNotInstanceOf(expected, actual);
        }

        public static void ShouldNotEqual<T>(this T actual, T expected)
        {
            Assert.AreNotEqual(expected, actual);
        }

        public static void ShouldNotEqual<T>(this T actual, T expected, string message)
        {
            Assert.AreNotEqual(expected, actual, message);
        }

        public static void ShouldEqual<T>(this T actual, T expected)
        {
            Assert.AreEqual(expected, actual);
        }
    }
}